//
//  DefineHeader.h
//  ConscienceWorldPorject
//
//  Created by 孙海琛 on 2019/11/22.
//  Copyright © 2019 孙海琛. All rights reserved.
//

#ifndef DefineHeader_h
#define DefineHeader_h

//定义log
#ifdef DEBUG
//#   define NSLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);

#   define NSLog(format, ...) printf("文件名:%s 行号:%d\n%s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String],__LINE__, [[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String])

#else
#   define NSLog(...)
#endif

//获取屏幕宽高
#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)

//颜色自定义
#define SHC_RGBA(r,g,b,a)    [UIColor colorWithRed:(float)r/255.0f green:(float)g/255.0f blue:(float)b/255.0f alpha:a]

//加载URL IMG
#define KIMG(imgName) [UIImage imageNamed:imgName]
#define KURL(url) [NSString isChinese:url]

//block selfClass
#define kWeakSelf __weak __typeof__(self) weakSelf = self;

/** View 圆角*/
#define ViewRadius(View, Radius)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES]

/** View 圆角和边框*/
#define ViewBorderRadius(View, Radius, Width, Color)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]]


//获取nav高度
#define kSafeTopMargin ((IS_IPHONE_X||IS_IPHONE_XRM) ? 88.f : 64.f)
/** iPhoneX*/
#define IS_IPHONE_X (IS_IPHONE && SCREEN_MAX_LENGTH == 812.0)
/** iPhoneXR和Max*/
#define IS_IPHONE_XRM (IS_IPHONE && SCREEN_MAX_LENGTH == 896.0)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))


//字符串属性
#define shc_string(name) @property (nonatomic,strong) NSString *name


#endif /* DefineHeader_h */
